﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.ServiceLocation;
using Microsoft.Practices.SharePoint.Common.ServiceLocation;
using Microsoft.SharePoint;

namespace ESF.SharePoint.Utility
{
    class ServiceLocatorHelper
    {
        public void RegisterType<TFrom, TTo>()
        {
           
        }

        public static T GetServiceInstance<T>(SPSite site, string name)
        {
            // Get ServiceLocator instance and obtain specified service instance
            IServiceLocator serviceLocator = SharePointServiceLocator.GetCurrent(site);
            return serviceLocator.GetInstance<T>(name);
        }

    }
}
